const {generateImage} = require("./image/echartsImage");
exports.createChart=function (req, res, next) {
    let options = req.body.options;
    if (typeof options === 'string') {
        options = JSON.parse(options)
    }
    let width = parseInt(req.query.width || req.body.width || 858)
    let height = parseInt(req.query.height || req.body.height || 271)
    let theme = req.query.theme || req.body.theme || null
    res.header("Content-Type", "image/png")


    // res.header("Content-Type", "application/xml")
    res.send(generateImage(options, width, height, theme))
}



